package test4;
//字符串截取
public class TestDemo5 {
    public static void main(String[] args) {
        String str="abcdefgh";
        String sub=str.substring(2);//提取子串
        System.out.println(sub);//cd
        System.out.println("====");
        String sub2=str.substring(2,4);
        System.out.println(sub2);//cd
    }
}
